<template>
  <div id="3d-graph"></div>
</template>

<script>
import dataset from '@/assets/js/blocks.json'
export default {
  layout: 'test',
  data() {
    return {
      elem: null,
      Graph: null,
      run: false,
    }
  },
  methods: {},
  mounted() {
    this.$nextTick(() => {
      const elem = document.getElementById('3d-graph')

      const Graph = window
        .ForceGraph3D()(elem)
        .graphData(dataset)
        .nodeAutoColorBy('user')
        .nodeLabel((node) => {
          return `${node.user}: ${node.description}`
        })
        .onNodeClick((node) => {})
    })
  },
}
</script>

<style>
</style>